package a.client.lib_base.ktx

import android.text.InputFilter
import android.widget.EditText

/**
@author:jacky
@Date:2021/1/26
 EditText相关扩展方法
 **/


/**
 * 过滤掉空格和回车
 */
fun EditText.filterBlankAndCarriageReturn() {
    this.filters =
        arrayOf(InputFilter { source, _, _, _, _, _ -> if (source == " " || source == "\n") "" else null})
}